<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			document.write("String('My String').charAt(1)的值为：" + String("My String").charAt(1) + "<br>");
			document.write("String('My String').charCodeAt(1)的值为：" + String("My String").charCodeAt(1) + "<br>");
			var str = new String("My String");
			document.write("My String的长度值为：" + str.length + "<br>");
			document.write("My String.indexOf('String')值为：" + str.indexOf("String") + "<br>");
			document.write("My String.slice(3,5)值为：" + str.slice(3, 5) + "<br>");
			var str1 = "What are you doing?"
			// split 分割之后的结果是一个数组
			var arrstr1 = str1.split(" ");
			document.write("What are you doing?用空格分隔后的结果：" + str1.split(" ") + "<br>")
			document.write("由字符编码创建字符串String.fromCharCode(65,66,67)：" + String.fromCharCode(65, 66, 67) + "<br>");
			//使用for循环来遍历分割之后的字符数组
			document.write("使用for循环来遍历分割之后的字符数组<br>");
			for(var i = 0; i < arrstr1.length; i++) {
				document.write(arrstr1[i] + "<br>");
			}
			document.write("使用for-in循环来遍历分割之后的字符数组<br>");
			for(var i in arrstr1) {
				document.write(arrstr1[i] + "<br>");
			}
			//下面的代码将输出为纯粹的HTML锚：<a name="anchorText">Anchor Text!</a>
			document.write(String("Anchor Text!").anchor("anchorText") + "<br>");
			var str2 = new String("搜狐首页");
			document.write(str2.link("http://www.sohu.com") + "<br>");
			document.write("str2原始值为：" + str2.valueOf() + "<br>");
		</script>
	</head>

	<body>
	</body>

</html>